// mircoApp/numberCollection/comm/goodsItem/goodsItem.js
Component({
  /**
   * 组件的属性列表
   */
  options: {
    multipleSlots: true,  // 在组件定义时的选项中启用多slot支持
    addGlobalClass: true
  },
  properties: {
    item:{
      type:Object,
      default:() => {
        return {}
      }
    },
    className:String,
    goodIndex:Number,
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    goodsTo(event) {
      let {id,goodsid} = event.currentTarget.dataset;
      if(this.data.className === 'classify' ) {
        wx.navigateTo({
          url: `/packageA/detail_v2/detail_v2?id=${id}`
        });
      } else if(this.data.className === 'covert') {
        wx.navigateTo({
         url: `/packageA/detail_v2/detail_v2?id=${goodsid}`
        });
      }
    }
  }
})
